/**
 * Created by Administrator on 2017-11-25
 */
define(function (require, exports, module) {
    'use strict';
    function addsceniclist() {
        var scenicname = $('#scenicname').val();
        var scenicdes = $('#scenicdes').val();
        $.ajax({
            url: '/scenicspot/addsceniclist',
            type: 'POST',
            data: {
                scenicname:scenicname,
                scenicdes:scenicdes,
                userid:user.id
            },
            success: function (res) {
                if (!res.success) {
                    alert(res.msg);
                    return;
                }else{
                    alert('成功!')
                }
            }
        })
    }

    function chooseinit() {
        $("#timemulchoose").blur(function(){
            var time = $("#timemulchoose").val();
            var timesize = $('#chooseresult').html();
            MAIN.shoplist('AT016',time,timesize);
        });
        $("#timesinchoose").blur(function(){
            var time = $("#timesinchoose").val();
            var timesize = $('#chooseresult').html();
            MAIN.shoplist('AT016',time,timesize);
        });
        $(".backcolor").click(function () {
            $("#sizechoose").hide();
            $(".backcolor").hide();
        })
        $("#spot-desc").click(function (event) {
            // event.preventDefault();
            // event.stopPropagation();//阻止冒泡事件，上级的单击事件不会被调用
            // $('.backcolor').show();
            // $('#sizechoose').show();
            MAIN.allshop('AT016');

            return false;
        })
    }
    function timechoose() {
        $('.backcolor').show();
        $('#sizechoose').show();
    }
    return {
        addsceniclist:addsceniclist,
        timechoose:timechoose,
        chooseinit:chooseinit
    }
})